package com.central.common.redis.component;

import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
import org.redisson.codec.JsonJacksonCodec;
import org.redisson.config.Config;
import org.redisson.spring.starter.RedissonAutoConfigurationCustomizer;
import org.springframework.stereotype.Component;

/**
 * @ClassName RedissonAutoConfigCustomizers
 * @Description TODO
 * @author: puyunqing
 * @Date: 2025/3/21
 */
@Component
public class RedissonAutoConfigCustomizers implements RedissonAutoConfigurationCustomizer {


    @Override
    public void customize(Config config) {
        JsonJacksonCodec jsonJacksonCodec = new JsonJacksonCodec();
        jsonJacksonCodec.getObjectMapper().registerModule(new JavaTimeModule());
        config.setCodec(jsonJacksonCodec);
    }
}
